package comday08.itheima01;

//学生类
//实体类
public class Student {
    //姓名
    private String name;
    //性别
    private String sex;
    //年龄
    private int age;
    //构造方法
    public Student() {
    }

    public Student(String name, String sex, int age) {
        this.name = name;
        this.sex = sex;
        this.age = age;
    }


    //set  get

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }


    //成员方法
    //吃饭方法
    //  马冬梅正在吃刀削面
    public void eat(String food){
        System.out.println(name + "正在吃" + food);
    }


    //toString

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", sex='" + sex + '\'' +
                ", age=" + age +
                '}';
    }
}
